function togglePageContent(){
  $("#page").toggle();
  cake = new Cake("krypton_demo");
  cake.setPiece("devCenterHidePage", !$("#page:visible").size());
}

function initDevCenter(){
  $("#devCenterLinks").mouseover(function(){
    $(this).css('opacity',1);
  }).mouseout(function(){
    $(this).css('opacity',0.25);
  });
  if(!$.browser.msie){
    $('#devCenterTabs').hide();
    cake = new Cake("krypton_demo");
    if(cake.getPiece("devCenter"))
      $("#devCenterTabs").show();
    if(cake.getPiece("devCenterHidePage"))
      togglePageContent();
    $("#devCenterButton").mousedown(function(){
      $("#devCenterTabs").toggle();
      cake.setPiece("devCenter",!cake.getPiece("devCenter"));
    })
    $("#devCenterTabs").tabs({
      "navClass": "tabs-dev",
      "containerClass": "tabs-dev-container"
    });
    $('#devCenter').show();
  }
}

$('#devCenter').hide();
$('#devCenterTabs').hide();
$(document).ready(function(){
  initDevCenter();
});
